/**
 * 载信软件(上海)有限公司
 * Copyright (c) 2015-2024 B5M,Inc.All Rights Reserved.
 */
package com.sys.midware.assist.utils.concurrent;

import java.util.concurrent.ExecutorService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ExecutorUtil {

    private static final Logger logger = LoggerFactory.getLogger(ExecutorUtil.class);

    public static void shutdown(ExecutorService es) {
        try {
            if (!es.isShutdown()) {
                es.shutdown();
            }
        } catch (Exception e) {
            try {
                es.shutdownNow();
            } catch (Exception e1) {
                logger.error("关闭线程池发生错误！", e1);
            }
        }
    }
}
